//
//  UIBarButtonItem+FK.m
//  NeteaseEdu
//
//  Created by xmc06 on 16/9/27.
//  Copyright © 2016年 zmosa. All rights reserved.
//

#import "UIBarButtonItem+FK.h"
#import "UIView+FK.h"

@implementation UIBarButtonItem (FK)

+ (UIBarButtonItem *)itemWithTarget:(id)target action:(SEL)action imageName:(NSString *)imageName highImageName:(NSString *)highImageName
{
    UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
    [button addTarget:target action:action forControlEvents:UIControlEventTouchUpInside];
    [button setBackgroundImage:[UIImage imageNamed:imageName] forState:UIControlStateNormal];
    [button setBackgroundImage:[UIImage imageNamed:highImageName] forState:UIControlStateHighlighted];
    button.fk_size = button.currentBackgroundImage.size;
    return [[UIBarButtonItem alloc] initWithCustomView:button];
}

@end
